Optimal. Leaf size=543 \[ -\frac {\left (A b^2-a (b B-a C)\right ) \sqrt {c+d \tan (e+f x)}}{2 b f \left (a^2+b^2\right ) (a+b \tan (e+f x))^2}-\frac {\sqrt {c+d \tan (e+f x)} \left (a^4 C d+3 a^3 b B d-a^2 b^2 (7 A d+4 B c-9 C d)+a b^3 (8 A c-5 B d-8 c C)+b^4 (A d+4 B c)\right )}{4 b f \left (a^2+b^2\right )^2 (b c-a d) (a+b \tan (e+f x))}+\frac {\left (a^6 C d^2+3 a^5 b B d^2-3 a^4 b^2 d (5 A d+4 B c-6 C d)+2 a^3 b^3 \left (20 c d (A-C)+B \left (4 c^2-13 d^2\right )\right )-3 a^2 b^4 \left (8 A c^2-6 A d^2-16 B c d-8 c^2 C+5 C d^2\right )-3 a b^5 \left (8 c d (A-C)+B \left (8 c^2-d^2\right )\right )-b^6 \left (4 c (B d+2 c C)-A \left (8 c^2+d^2\right )\right )\right ) \tanh ^{-1}\left (\frac {\sqrt {b} \sqrt {c+d \tan (e+f x)}}{\sqrt {b c-a d}}\right )}{4 b^{3/2} f \left (a^2+b^2\right )^3 (b c-a d)^{3/2}}-\frac {\sqrt {c-i d} (A-i B-C) \tanh ^{-1}\left (\frac {\sqrt {c+d \tan (e+f x)}}{\sqrt {c-i d}}\right )}{f (b+i a)^3}+\frac {\sqrt {c+i d} (A+i B-C) \tanh ^{-1}\left (\frac {\sqrt {c+d \tan (e+f x)}}{\sqrt {c+i d}}\right )}{f (-b+i a)^3} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 4.04, antiderivative size = 543, normalized size of antiderivative = 1.00, number of steps used = 13, number of rules used = 8, integrand size = 47, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.170, Rules used = {3645, 3649, 3653, 3539, 3537, 63, 208, 3634} \[ \frac {\left (2 a^3 b^3 \left (20 c d (A-C)+B \left (4 c^2-13 d^2\right )\right )-3 a^2 b^4 \left (8 A c^2-6 A d^2-16 B c d-8 c^2 C+5 C d^2\right )-3 a^4 b^2 d (5 A d+4 B c-6 C d)+3 a^5 b B d^2+a^6 C d^2-3 a b^5 \left (8 c d (A-C)+B \left (8 c^2-d^2\right )\right )-b^6 \left (4 c (B d+2 c C)-A \left (8 c^2+d^2\right )\right )\right ) \tanh ^{-1}\left (\frac {\sqrt {b} \sqrt {c+d \tan (e+f x)}}{\sqrt {b c-a d}}\right )}{4 b^{3/2} f \left (a^2+b^2\right )^3 (b c-a d)^{3/2}}-\frac {\left (A b^2-a (b B-a C)\right ) \sqrt {c+d \tan (e+f x)}}{2 b f \left (a^2+b^2\right ) (a+b \tan (e+f x))^2}-\frac {\sqrt {c+d \tan (e+f x)} \left (-a^2 b^2 (7 A d+4 B c-9 C d)+3 a^3 b B d+a^4 C d+a b^3 (8 A c-5 B d-8 c C)+b^4 (A d+4 B c)\right )}{4 b f \left (a^2+b^2\right )^2 (b c-a d) (a+b \tan (e+f x))}-\frac {\sqrt {c-i d} (A-i B-C) \tanh ^{-1}\left (\frac {\sqrt {c+d \tan (e+f x)}}{\sqrt {c-i d}}\right )}{f (b+i a)^3}+\frac {\sqrt {c+i d} (A+i B-C) \tanh ^{-1}\left (\frac {\sqrt {c+d \tan (e+f x)}}{\sqrt {c+i d}}\right )}{f (-b+i a)^3} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 63
Rule 208
Rule 3537
Rule 3539
Rule 3634
Rule 3645
Rule 3649
Rule 3653
Rubi steps
\begin {align*} \int \frac {\sqrt {c+d \tan (e+f x)} \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right )}{(a+b \tan (e+f x))^3} \, dx &=-\frac {\left (A b^2-a (b B-a C)\right ) \sqrt {c+d \tan (e+f x)}}{2 b \left (a^2+b^2\right ) f (a+b \tan (e+f x))^2}+\frac {\int \frac {\frac {1}{2} \left (2 (b B-a C) \left (2 b c-\frac {a d}{2}\right )+A b (4 a c+b d)\right )-2 b ((A-C) (b c-a d)-B (a c+b d)) \tan (e+f x)-\frac {1}{2} \left (3 A b^2-3 a b B-a^2 C-4 b^2 C\right ) d \tan ^2(e+f x)}{(a+b \tan (e+f x))^2 \sqrt {c+d \tan (e+f x)}} \, dx}{2 b \left (a^2+b^2\right )}\\ &=-\frac {\left (A b^2-a (b B-a C)\right ) \sqrt {c+d \tan (e+f x)}}{2 b \left (a^2+b^2\right ) f (a+b \tan (e+f x))^2}-\frac {\left (3 a^3 b B d+a^4 C d+b^4 (4 B c+A d)+a b^3 (8 A c-8 c C-5 B d)-a^2 b^2 (4 B c+7 A d-9 C d)\right ) \sqrt {c+d \tan (e+f x)}}{4 b \left (a^2+b^2\right )^2 (b c-a d) f (a+b \tan (e+f x))}-\frac {\int \frac {\frac {1}{4} \left (-\left (2 a b c-2 a^2 d-b^2 d\right ) \left (a^2 C d+b^2 (4 B c+A d)+a b (4 A c-4 c C-B d)\right )+(2 b c-a d) \left (3 a^2 b B d+a^3 C d+A b^2 (4 b c-7 a d)-4 b^3 (c C+B d)-4 a b^2 (B c-2 C d)\right )\right )+2 b (b c-a d) \left (2 a b (A c-c C-B d)-a^2 (B c+(A-C) d)+b^2 (B c+(A-C) d)\right ) \tan (e+f x)+\frac {1}{4} d \left (3 a^3 b B d+a^4 C d+b^4 (4 B c+A d)+a b^3 (8 A c-8 c C-5 B d)-a^2 b^2 (4 B c+7 A d-9 C d)\right ) \tan ^2(e+f x)}{(a+b \tan (e+f x)) \sqrt {c+d \tan (e+f x)}} \, dx}{2 b \left (a^2+b^2\right )^2 (b c-a d)}\\ &=-\frac {\left (A b^2-a (b B-a C)\right ) \sqrt {c+d \tan (e+f x)}}{2 b \left (a^2+b^2\right ) f (a+b \tan (e+f x))^2}-\frac {\left (3 a^3 b B d+a^4 C d+b^4 (4 B c+A d)+a b^3 (8 A c-8 c C-5 B d)-a^2 b^2 (4 B c+7 A d-9 C d)\right ) \sqrt {c+d \tan (e+f x)}}{4 b \left (a^2+b^2\right )^2 (b c-a d) f (a+b \tan (e+f x))}-\frac {\int \frac {-2 b (b c-a d) \left (a^3 (A c-c C-B d)-3 a b^2 (A c-c C-B d)+3 a^2 b (B c+(A-C) d)-b^3 (B c+(A-C) d)\right )+2 b (b c-a d) \left (3 a^2 b (A c-c C-B d)-b^3 (A c-c C-B d)-a^3 (B c+(A-C) d)+3 a b^2 (B c+(A-C) d)\right ) \tan (e+f x)}{\sqrt {c+d \tan (e+f x)}} \, dx}{2 b \left (a^2+b^2\right )^3 (b c-a d)}-\frac {\left (3 a^5 b B d^2+a^6 C d^2-3 a^4 b^2 d (4 B c+5 A d-6 C d)-3 a^2 b^4 \left (8 A c^2-8 c^2 C-16 B c d-6 A d^2+5 C d^2\right )+2 a^3 b^3 \left (20 c (A-C) d+B \left (4 c^2-13 d^2\right )\right )-3 a b^5 \left (8 c (A-C) d+B \left (8 c^2-d^2\right )\right )-b^6 \left (4 c (2 c C+B d)-A \left (8 c^2+d^2\right )\right )\right ) \int \frac {1+\tan ^2(e+f x)}{(a+b \tan (e+f x)) \sqrt {c+d \tan (e+f x)}} \, dx}{8 b \left (a^2+b^2\right )^3 (b c-a d)}\\ &=-\frac {\left (A b^2-a (b B-a C)\right ) \sqrt {c+d \tan (e+f x)}}{2 b \left (a^2+b^2\right ) f (a+b \tan (e+f x))^2}-\frac {\left (3 a^3 b B d+a^4 C d+b^4 (4 B c+A d)+a b^3 (8 A c-8 c C-5 B d)-a^2 b^2 (4 B c+7 A d-9 C d)\right ) \sqrt {c+d \tan (e+f x)}}{4 b \left (a^2+b^2\right )^2 (b c-a d) f (a+b \tan (e+f x))}+\frac {((A-i B-C) (c-i d)) \int \frac {1+i \tan (e+f x)}{\sqrt {c+d \tan (e+f x)}} \, dx}{2 (a-i b)^3}+\frac {((A+i B-C) (c+i d)) \int \frac {1-i \tan (e+f x)}{\sqrt {c+d \tan (e+f x)}} \, dx}{2 (a+i b)^3}-\frac {\left (3 a^5 b B d^2+a^6 C d^2-3 a^4 b^2 d (4 B c+5 A d-6 C d)-3 a^2 b^4 \left (8 A c^2-8 c^2 C-16 B c d-6 A d^2+5 C d^2\right )+2 a^3 b^3 \left (20 c (A-C) d+B \left (4 c^2-13 d^2\right )\right )-3 a b^5 \left (8 c (A-C) d+B \left (8 c^2-d^2\right )\right )-b^6 \left (4 c (2 c C+B d)-A \left (8 c^2+d^2\right )\right )\right ) \operatorname {Subst}\left (\int \frac {1}{(a+b x) \sqrt {c+d x}} \, dx,x,\tan (e+f x)\right )}{8 b \left (a^2+b^2\right )^3 (b c-a d) f}\\ &=-\frac {\left (A b^2-a (b B-a C)\right ) \sqrt {c+d \tan (e+f x)}}{2 b \left (a^2+b^2\right ) f (a+b \tan (e+f x))^2}-\frac {\left (3 a^3 b B d+a^4 C d+b^4 (4 B c+A d)+a b^3 (8 A c-8 c C-5 B d)-a^2 b^2 (4 B c+7 A d-9 C d)\right ) \sqrt {c+d \tan (e+f x)}}{4 b \left (a^2+b^2\right )^2 (b c-a d) f (a+b \tan (e+f x))}-\frac {((A+i B-C) (c+i d)) \operatorname {Subst}\left (\int \frac {1}{(-1+x) \sqrt {c+i d x}} \, dx,x,-i \tan (e+f x)\right )}{2 (i a-b)^3 f}+\frac {((A-i B-C) (i c+d)) \operatorname {Subst}\left (\int \frac {1}{(-1+x) \sqrt {c-i d x}} \, dx,x,i \tan (e+f x)\right )}{2 (a-i b)^3 f}-\frac {\left (3 a^5 b B d^2+a^6 C d^2-3 a^4 b^2 d (4 B c+5 A d-6 C d)-3 a^2 b^4 \left (8 A c^2-8 c^2 C-16 B c d-6 A d^2+5 C d^2\right )+2 a^3 b^3 \left (20 c (A-C) d+B \left (4 c^2-13 d^2\right )\right )-3 a b^5 \left (8 c (A-C) d+B \left (8 c^2-d^2\right )\right )-b^6 \left (4 c (2 c C+B d)-A \left (8 c^2+d^2\right )\right )\right ) \operatorname {Subst}\left (\int \frac {1}{a-\frac {b c}{d}+\frac {b x^2}{d}} \, dx,x,\sqrt {c+d \tan (e+f x)}\right )}{4 b \left (a^2+b^2\right )^3 d (b c-a d) f}\\ &=\frac {\left (3 a^5 b B d^2+a^6 C d^2-3 a^4 b^2 d (4 B c+5 A d-6 C d)-3 a^2 b^4 \left (8 A c^2-8 c^2 C-16 B c d-6 A d^2+5 C d^2\right )+2 a^3 b^3 \left (20 c (A-C) d+B \left (4 c^2-13 d^2\right )\right )-3 a b^5 \left (8 c (A-C) d+B \left (8 c^2-d^2\right )\right )-b^6 \left (4 c (2 c C+B d)-A \left (8 c^2+d^2\right )\right )\right ) \tanh ^{-1}\left (\frac {\sqrt {b} \sqrt {c+d \tan (e+f x)}}{\sqrt {b c-a d}}\right )}{4 b^{3/2} \left (a^2+b^2\right )^3 (b c-a d)^{3/2} f}-\frac {\left (A b^2-a (b B-a C)\right ) \sqrt {c+d \tan (e+f x)}}{2 b \left (a^2+b^2\right ) f (a+b \tan (e+f x))^2}-\frac {\left (3 a^3 b B d+a^4 C d+b^4 (4 B c+A d)+a b^3 (8 A c-8 c C-5 B d)-a^2 b^2 (4 B c+7 A d-9 C d)\right ) \sqrt {c+d \tan (e+f x)}}{4 b \left (a^2+b^2\right )^2 (b c-a d) f (a+b \tan (e+f x))}-\frac {((A+i B-C) (c+i d)) \operatorname {Subst}\left (\int \frac {1}{-1+\frac {i c}{d}-\frac {i x^2}{d}} \, dx,x,\sqrt {c+d \tan (e+f x)}\right )}{(a+i b)^3 d f}+\frac {((A-i B-C) (i c+d)) \operatorname {Subst}\left (\int \frac {1}{-1-\frac {i c}{d}+\frac {i x^2}{d}} \, dx,x,\sqrt {c+d \tan (e+f x)}\right )}{(i a+b)^3 d f}\\ &=-\frac {(A-i B-C) \sqrt {c-i d} \tanh ^{-1}\left (\frac {\sqrt {c+d \tan (e+f x)}}{\sqrt {c-i d}}\right )}{(i a+b)^3 f}+\frac {(A+i B-C) \sqrt {c+i d} \tanh ^{-1}\left (\frac {\sqrt {c+d \tan (e+f x)}}{\sqrt {c+i d}}\right )}{(i a-b)^3 f}+\frac {\left (3 a^5 b B d^2+a^6 C d^2-3 a^4 b^2 d (4 B c+5 A d-6 C d)-3 a^2 b^4 \left (8 A c^2-8 c^2 C-16 B c d-6 A d^2+5 C d^2\right )+2 a^3 b^3 \left (20 c (A-C) d+B \left (4 c^2-13 d^2\right )\right )-3 a b^5 \left (8 c (A-C) d+B \left (8 c^2-d^2\right )\right )-b^6 \left (4 c (2 c C+B d)-A \left (8 c^2+d^2\right )\right )\right ) \tanh ^{-1}\left (\frac {\sqrt {b} \sqrt {c+d \tan (e+f x)}}{\sqrt {b c-a d}}\right )}{4 b^{3/2} \left (a^2+b^2\right )^3 (b c-a d)^{3/2} f}-\frac {\left (A b^2-a (b B-a C)\right ) \sqrt {c+d \tan (e+f x)}}{2 b \left (a^2+b^2\right ) f (a+b \tan (e+f x))^2}-\frac {\left (3 a^3 b B d+a^4 C d+b^4 (4 B c+A d)+a b^3 (8 A c-8 c C-5 B d)-a^2 b^2 (4 B c+7 A d-9 C d)\right ) \sqrt {c+d \tan (e+f x)}}{4 b \left (a^2+b^2\right )^2 (b c-a d) f (a+b \tan (e+f x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] time = 6.38, size = 2819, normalized size = 5.19 \[ \text {Result too large to show} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.88, size = 9797, normalized size = 18.04 \[ \text {output too large to display} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: ValueError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [F(-1)] time = 0.00, size = -1, normalized size = -0.00 \[ \text {Hanged} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\sqrt {c + d \tan {\left (e + f x \right )}} \left (A + B \tan {\left (e + f x \right )} + C \tan ^{2}{\left (e + f x \right )}\right )}{\left (a + b \tan {\left (e + f x \right )}\right )^{3}}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________